home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / System / MCC_SpeedBar / Developer / C / Include / MUI / SpeedBar_mcc.h next >
C/C++ Source or Header  |  2000-04-21  |  5KB  |  140 lines

  1. #ifndef SPEEDBAR_MCC_H
  2. #define SPEEDBAR_MCC_H
  3.  
  4. /*********************************************************
  5. **                                                      **
  6. **      SpeedBar.mcc                                    **
  7. **                                                      **
  8. **              ©1999 Simone Tellini                    **
  9. **                                                      **
  10. *********************************************************/
  11.  
  12. #ifndef LIBRARIES_MUI_H
  13. #include <libraries/mui.h>
  14. #endif
  15.  
  16. /// Support stuff
  17. #ifndef REG
  18. #ifdef _DCC
  19. #define REG(x) __ ## x
  20. #else
  21. #define REG(x) register __ ## x
  22. #endif
  23. #endif
  24.  
  25. #ifndef ASM
  26. #if defined __MAXON__ || defined __STORM__ || defined _DCC
  27. #define ASM
  28. #else
  29. #define ASM __asm
  30. #endif
  31. #endif
  32.  
  33. #ifndef SAVEDS
  34. #ifdef __MAXON__
  35. #define SAVEDS
  36. #endif
  37. #if defined __STORM__ || defined __SASC
  38. #define SAVEDS __saveds
  39. #endif
  40. #if defined _GCC || defined _DCC
  41. #define SAVEDS __geta4
  42. #endif
  43. #endif
  44.  
  45.  
  46. #ifndef MAKE_ID
  47. #define MAKE_ID(a,b,c,d)    ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  48. #endif
  49.  
  50. #ifndef MIN
  51. #define MIN(a,b)    (( a < b ) ? ( a ) : ( b ))
  52. #endif
  53.  
  54. #ifndef MAX
  55. #define MAX(a,b)    (( a > b ) ? ( a ) : ( b ))
  56. #endif
  57.  
  58. #ifndef ABS
  59. #define ABS(a) (((a) > 0) ? (a) : -(a))
  60. #endif
  61. ///
  62.  
  63.  
  64. #define MUIC_SpeedBar       "SpeedBar.mcc"
  65. #define SpeedBarObject      MUI_NewObject( MUIC_SpeedBar
  66.  
  67. #define SBTAGBASE           0xF76B00A0
  68.  
  69.  
  70. /*************************
  71. **      Methods         **
  72. *************************/
  73.  
  74. #define MUIM_SpeedBar_AddButton         (SBTAGBASE + 1)
  75. #define MUIM_SpeedBar_AddButtonObject   (SBTAGBASE + 2)
  76. #define MUIM_SpeedBar_AddSpacer         (SBTAGBASE + 3)
  77. #define MUIM_SpeedBar_Clear             (SBTAGBASE + 4)
  78. #define MUIM_SpeedBar_Rebuild           (SBTAGBASE + 5)
  79. #define MUIM_SpeedBar_AddNotify         (SBTAGBASE + 6)     /*  PRIVATE  */
  80. #define MUIM_SpeedBar_GetObject         (SBTAGBASE + 7)
  81. #define MUIM_SpeedBar_DoOnButton        (SBTAGBASE + 8)
  82.  
  83.  
  84. /*************************
  85. **      Attributes      **
  86. *************************/
  87.  
  88. #define MUIA_SpeedBar_Borderless        (SBTAGBASE + 1)     /*  BOOL                IS.. */
  89. #define MUIA_SpeedBar_Images            (SBTAGBASE + 2)     /*  struct MyBrush **   I.G. */
  90. #define MUIA_SpeedBar_SpacerIndex       (SBTAGBASE + 3)     /*  UWORD               I.G. */
  91. #define MUIA_SpeedBar_RaisingFrame      (SBTAGBASE + 4)     /*  BOOL                IS.. */
  92. #define MUIA_SpeedBar_Buttons           (SBTAGBASE + 5)     /*  struct SBButtons *  I... */
  93. #define MUIA_SpeedBar_ViewMode          (SBTAGBASE + 6)     /*  UWORD               ISG. */
  94. #define MUIA_SpeedBar_SameWidth         (SBTAGBASE + 7)     /*  BOOL                I... */
  95. #define MUIA_SpeedBar_Spread            (SBTAGBASE + 8)     /*  BOOL                I... */
  96. #define MUIA_SpeedBar_StripUnderscore   (SBTAGBASE + 9)     /*  BOOL                I... */
  97. #define MUIA_SpeedBar_SmallImages       (SBTAGBASE + 10)    /*  BOOL                IS.. */
  98. #define MUIA_SpeedBar_Sunny             (SBTAGBASE + 11)    /*  BOOL                IS.. */
  99. #define MUIA_SpeedBar_SameHeight        (SBTAGBASE + 12)    /*  BOOL                I... */
  100.  
  101.  
  102. /*************************
  103. **      Values          **
  104. *************************/
  105.  
  106. #define MUIV_SpeedBar_Spacer            ((ULONG)-1)
  107. #define MUIV_SpeedBar_End               ((ULONG)-2) // ends a MUIS_SpeedBar_Button array
  108.  
  109. #define MUIV_SpeedBar_ButtonFlag_Immediate  (1 << 0)
  110. #define MUIV_SpeedBar_ButtonFlag_Disabled   (1 << 1)
  111. #define MUIV_SpeedBar_ButtonFlag_Selected   (1 << 2)
  112. #define MUIV_SpeedBar_ButtonFlag_Toggle     (1 << 3)
  113.  
  114. #define MUIV_SpeedBar_ViewMode_TextGfx  0
  115. #define MUIV_SpeedBar_ViewMode_Gfx      1
  116. #define MUIV_SpeedBar_ViewMode_Text     2
  117.  
  118.  
  119. /*************************
  120. **      Structures      **
  121. *************************/
  122.  
  123. struct MUIS_SpeedBar_Button {
  124.         ULONG           Img;        /* image index                                          */
  125.         STRPTR          Text;       /* button label                                         */
  126.         STRPTR          Help;       /* button help                                          */
  127.         UWORD           Flags;
  128.         struct IClass  *Class;      /* easy way of getting a toolbar of subclassed buttons  */
  129.         Object         *Object;     /* filled after init                                    */
  130. };
  131.  
  132. struct MUIP_SpeedBar_AddButton { ULONG MethodID; struct MUIS_SpeedBar_Button *Button; };
  133. struct MUIP_SpeedBar_AddButtonObject { ULONG MethodID; Object *Button; };
  134. struct MUIP_SpeedBar_AddNotify { ULONG MethodID; Object *Dest; struct MUIP_Notify *Msg; };
  135. struct MUIP_SpeedBar_GetObject { ULONG MethodID; ULONG Object; };
  136. struct MUIP_SpeedBar_DoOnButton { ULONG MethodID; ULONG Button; ULONG Method; /* ...args... */ };
  137.  
  138.  
  139. #endif /* SPEEDBAR_MCC_H */
  140.